<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<div id="fenye">
			<input id="currentPage" name="currentPage" value="${currentPage }" type="hidden"/>
			
			<span>
				<c:choose>
					<c:when test="${currentPage==0}">
						<input id="befor_buttom" type="button" value="上一页" disabled="disabled"/>
					</c:when>
					<c:otherwise>
						<input id="befor_buttom" type="button" value="上一页" />
					</c:otherwise>
				</c:choose>
			</span>
			<c:if test="${currentPage>3}">
				<span class="pn">1</span>
				<span>...</span>
			</c:if>
			<c:choose>
				<c:when test="${totalPageNum<=4}">
					<c:forEach begin="1" end="${totalPageNum}" step="1" var="count">
						<c:choose>
							<c:when test="${count==currentPage}"><span class="curpn">${count}</span></c:when>
							<c:otherwise><span class="pn">${count}</span></c:otherwise>
						</c:choose>
					</c:forEach>
				</c:when>
				<c:when test="${totalPageNum>4&&(currentPage+4)<=totalPageNum}">
					<c:forEach begin="${currentPage}" end="${currentPage+4}" step="1" var="count">
						<c:choose> 
							<c:when test="${count==currentPage}"><span class="curpn">${count}</span></c:when>
							<c:otherwise><span class="pn">${count}</span></c:otherwise>
						</c:choose>
					</c:forEach>
					<c:if test="${currentPage+4<totalPageNum}">
						<span>...</span>
						<span class="pn">${totalPageNum }</span>
					</c:if>
				</c:when>
				<c:otherwise>
					<c:forEach begin="${totalPageNum-4}" end="${totalPageNum-1}" step="1" var="count">
						<c:choose>
							<c:when test="${count==currentPage}"><span class="curpn">${count}</span></c:when>
							<c:otherwise><span class="pn">${count}</span></c:otherwise>
						</c:choose>
					</c:forEach>
					<c:if test="${totalPageNum-currentPage>4}">
						<span>...</span>
					</c:if>
					<c:choose>
							<c:when test="${totalPageNum==currentPage}"><span class="curpn">${totalPageNum }</span></c:when>
							<c:otherwise><span class="pn">${totalPageNum }</span></span></c:otherwise>
					</c:choose>
				</c:otherwise>
			</c:choose>
			<span>
				<c:choose>
					<c:when test="${currentPage==totalPageNum||totalPageNum==0}">
						<input id="next_buttom" type="button" value="下一页" disabled="disabled"/>
					</c:when>
					<c:otherwise>
						<input id="next_buttom" type="button" value="下一页"/>
					</c:otherwise>
				</c:choose>
			</span> 
		</div>
</body>
</html>